<% if @wished_item.present? %>
  <%= turbo_stream.remove dom_id(@wished_item) %>
<% end %>

<% if current_wishlist.wished_items.none? %>
  <%= turbo_stream.replace 'wishlist' do %>
    <div class="lg:col-span-9 lg:col-start-4 mb-12 lg:mb-24" id="wishlist">
      <%= render 'spree/wishlists/no_wished_items' %>
    </div>
  <% end %>
<% end %>

<% if flash[:error] %>
  <%= spree_turbo_update_flashes %>
<% end %>

<%= turbo_stream.update "wishlist-icon" do %>
  <%= javascript_tag "wishedVariantIds = #{(current_wishlist.variant_ids).to_json.html_safe};" %>
  <%= render 'spree/shared/wishlist_icon' %>
<% end %>
